<template>
	<view class="duringtheexamination">
		<view class="content">
			<view class="head">
				<view class="head-left">
					<image v-if="user.avatar" :src="URL + user.avatar" alt=""></image>
					<image v-else src="../../static/image/frame-active.png" alt=""></image>
				</view>
				<view class="head-right">
					<view class="right-top">
						<text>{{user.nickName}}</text>
						<image src="../../static/operation/sbz.png" mode=""></image>
					</view>
					<view class="right-foot"> {{user.deptName}} . {{user.postName}}</view>
					<view class="right-foot">{{user.gzdw}} </view>
				</view>
			</view>
			<view class="card">
				<view class="card-content" @click="switchover(item.id)" v-for="item in list" :key="item.id">
					<image :src="item.url" mode=""></image><br />
					<text>{{item.text}}</text>
				</view>
			</view>
			<view class="foot">
				<view class="box" @click="aboutUs">
					<view class="box-left">
						<image src="../../static/operation/gywm.png" mode=""></image>
						<text>关于我们</text>
					</view>
					<view class="box-icon">
						<u-icon name="arrow-right"></u-icon>
					</view>
				</view>
				<view class="box" @click="install">
					<view class="box-left">
						<image src="../../static/operation/sz.png" mode=""></image>
						<text>设置</text>
					</view>
					<view class="box-icon">
						<u-icon name="arrow-right"></u-icon>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		URL
	} from '@/api/public.js'
	export default {
		data() {
			return {
				URL: URL,
				user: null,
				list: [{
						id: 1,
						url: '../../static/operation/wdzs.png',
						text: '我的证书'
					},
					{
						id: 2,
						url: '../../static/operation/wdsk.png',
						text: '我的三卡'
					},
					{
						id: 3,
						url: '../../static/operation/jcjl.png',
						text: '奖惩记录'
					},
					{
						id: 4,
						url: '../../static/operation/dwkp.png',
						text: '定位卡片'
					}
				]
			}
		},
		onLoad() {
			this.user = uni.getStorageSync("userINFO")
		},
		methods: {
			aboutUs() {
				uni.navigateTo({
					url: '/pages/aboutUs/aboutUs'
				})
			},
			install() {
				uni.navigateTo({
					url: '/pages/install/install'
				})
			},
			switchover(val) {
				if (val == 1) {
					uni.navigateTo({
						url: '/pages/certificate/certificate'
					})
				} else if (val == 2) {
					uni.navigateTo({
						url: '/pages/threecard/threecard'
					})
				} else if (val == 3) {
					uni.navigateTo({
						url: '/pages/disciplinaryrecords/disciplinaryrecords'
					})
				} else if (val == 4) {
					uni.navigateTo({
						url: '/pages/locationcard/locationcard'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.duringtheexamination {
		width: 100%;
		padding: 24rpx;
		box-sizing: border-box;
		background-color: #F6F6F6;

		.content {
			width: 100%;
			background-color: #F6F6F6;

			.head {
				width: 702rpx;
				height: 144rpx;
				margin-bottom: 16rpx;
				display: flex;

				.head-left {
					display: flex;
					justify-content: center;
					align-items: center;
					width: 120rpx;
					height: 120rpx;
					border-radius: 10px;
					overflow: hidden;
					background-color: #eee209;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.head-right {
					height: 144rpx;
					margin-left: 16rpx;

					.right-top {
						display: flex;

						text {
							font-size: 36rpx;
							color: #333333;
							font-weight: bold;
						}

						image {
							margin-left: 16rpx;
							margin-top: 5rpx;
							width: 92rpx;
							height: 40rpx;
							border-radius: 4rpx;
						}
					}

					.right-foot {
						font-size: 28rpx;
						color: #999999;
					}

				}

			}

			.card {
				width: 702rpx;
				height: 204rpx;
				background-color: #fff;
				padding: 36rpx 24rpx 24rpx;
				box-sizing: border-box;
				display: flex;
				justify-content: space-between;
				border-radius: 16rpx;
				margin-bottom: 16rpx;

				// background-color: aqua;
				.card-content {
					text-align: center;

					image {
						width: 64rpx;
						height: 64rpx;
					}

					text {
						font-size: 24rpx;
						color: #666666;
					}
				}

			}

			.foot {
				width: 702rpx;
				height: 224rpx;
				background-color: #fff;

				.box {
					width: 702rpx;
					height: 112rpx;
					background-color: #fff;
					padding: 32rpx 64rpx;
					box-sizing: border-box;
					display: flex;
					justify-content: space-between;

					.box-left {

						// line-height: 112rpx;
						image {
							width: 48rpx;
							height: 48rpx;
							vertical-align: middle;
						}

						text {
							margin-left: 16rpx;
							font-size: 32rpx;
							color: #666666;
							vertical-align: middle;
						}
					}

					.box-icon {
						margin-top: 10rpx;
					}
				}
			}

		}
	}
</style>
